import request from '@/utils/request'

// 获取子部门信息
export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

// 新增子部门
export function addDepartment(data) {
  return request({
    url: 'company/department',
    menthod: 'post',
    data
  })
}

// 获取部门详情数据
export function getDepartmentDetail(id) {
  return request({
    url: `company/department/${id}`
  })
}

// 编辑部门信息
export function updateDepartments(data) {
  return request({
    url: `company/department/${data.id}`,
    method: 'put',
    data
  })
}

// 删除部门信息
export function delDepartment(id) {
  return request({
    url: `company/department/${id}`,
    method: 'delete'
  })
}

